package com.reyco1.media.audio
{
	import com.reyco1.util.Delegate;

	public class AudioCuePoint
	{
		public var id:String
		public var time:int;
		public var method:Function;
		public var params:Array;
		public var used:Boolean;
		
		public function AudioCuePoint(time:int, method:Function, params:Array = null, name:String = null)
		{
			this.time   = time;
			this.method = method;
			this.params = params;
			this.id		= name;
			
			used = false;
		}
		
		public function execute():void
		{
			if(method != null)
				Delegate.execute(method, params);
			
			used = true;
		}
		
		public function reset():void
		{
			used = false;
		}
		
		public function clear():void
		{
			method = null;
			params = null;
		}
	}
}